import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int p = scanner.nextInt();
        for (int i = 1; i < p; i++) {
            for (int j = 1; j <= i; j++) {
                int product = i * j;
                String iStr = convertToBase(i, p);
                String jStr = convertToBase(j, p);
                String productStr = convertToBase(product, p);
                System.out.print(iStr + "*" + jStr + "=" + productStr + " ");
            }
            System.out.println();
        }
    }

    public static String convertToBase(int num, int base) {
        if (num == 0) return "0";
        StringBuilder result = new StringBuilder();
        while (num > 0) {
            int remainder = num % base;
            if (remainder < 10) {
                result.append(remainder);
            } else {
                result.append((char)('A'+ (remainder - 10)));
            }
            num /= base;
        }
        return result.reverse().toString();
    }
}